home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
pdsrt212.zip
/
PDSORT.DOC
< prev
next >
Wrap
Text File
|
1990-06-19
|
15KB
|
306 lines
PDSORT
A Public Domain External Sort Program
Author: Don A. Williams
Version: 2.1.2
Date: June 20, 1990
**************************** NOTICE! **************************
* Contrary to the current trend in MS-DOS software this *
* program, for whatever it is worth, is NOT copyrighted *
* (with the exception of the runtime library from Borland *
* International's Turbo C)! The program, in whole or in *
* part, may be used freely in any fashion or environment *
* desired. If you find this program to be useful to you, *
* do NOT send any contribution to the author; in the words *
* of Rick Conn, 'Enjoy!' However, if you make any *
* improvements, I would enjoy receiving a copy of the *
* modified source. I can be reached, usually within 24 *
* hours, by messages on any of the Phoenix systems, *
* particularly: *
* *
* The Tool Shop BBS [PCBOARD] *
* (602) 279-2673 1200/2400/9600 bps *
* (Good luck trying! VERY BUSY!) *
* Technoids Anonymous [PCBOARD] *
* (602) 899-4876 300/1200/2400 bps *
* *
* All can be reached through PC Pursuit. *
* *
* or: *
* on GEnie, mail address: DON-WILL *
* on CompuServ: 75410,543 *
* *
* Every effort has been made to avoid error and moderately *
* extensive testing has been performed on this program, *
* however, the author does not warrant it to be fit for any *
* purpose or to be free from error and disclaims any *
* liability for actual or any other damage arising from the *
* use of this program. *
*****************************************************************
PDSORT is a fully public domain external sort program, i.e. it can
sort files that are too big to be wholly contained in memory. The
length of the file that can be sorted by PDSORT is limited only by the
available disk space, however, you must have at least twice as much
free space as the length of the file to be sorted - PDSORT uses an
intermediate file the size of the input file and the sorted output
file will be the same size as the input file.
USAGE:
There are two forms for executing PDSORT:
pdsort in_file out_file [option] max_record_length [key_spec ....]
and:
pdsort - [option] max_record_length [key_spec ....] <in_file >out_file
In the first form, the input_file specification can be any standard
MS-DOS file specification including full path specifications but may
NOT contain "wild cards". The output_file specification may also be
any standard MS-DOS file specification not containing "wild cards".
The input_file and output_file names may be the same but, in this
case, the input_file will be destroyed by PDSORT by overwriting it
with the input file. The max_record_length argument is required and
no records in the input file may exceed this value. If a record is
detected in the input file that exceeds the specified maximum record
length, PDSORT will issue a message identifying the record and will
terminate.
In the second form, PDSORT executes as a "filter", reading and sorting
standard input to produce standard output, both of which may ne
redirected.
Options:
The only options supported by version 2.0.0 of PDSORT are:
-······A single '-', delimited by blanks, instructs PDSORT to
operate as a filter, taking its input from standard input
and sending its output to standard output.
-tpath·The '-t option allows the user to specify the path for the
intermediate file created by PDSORT. If no such path is
specified, PDSORT will use the path of the output file as
the path of the intermediate file. If the "filter" option
is selected and no intermediate file path is specified, the
intermediate file will be created in the current directory.
Key Specification:
There may be as many keys specified as you wish. The file will be
sorted on the keys in the order in which they are specified. Each
key_spec has one of the following two formats:
b:l:[field_options]
or:
b-e:[field_options]
where:
b·-·Specifies the beginning character position of the field in
decimal; i.e to sort a field that is in columns 10 through 17
of the record, b would be 10.
l·-·Specifies the length of the field in characters; i.e to sort a
field that is in columns 10 through 17 of the record, l would
be 8 - 10:8[:options].
e·-·Specifies the ending character position of the field in
decimal, inclusive; i.e to sort a file that is in characters
10 through 17 of the record with this format of the field
specifier would require the e be 17 - 10-17[:options].
Field Options:
a·-·Specifies that the sort on this field is to be in ascending
order, the default if no field option is specified for this
field.
d·-·Specifies that the sort on this field is to be in descending
order.
c·-·Specifies that the sort on this field is to be case sensitive;
i.e. the word Abscess" would sort lower that the word
"abscess". A case sensitive sort is the default if none
is specified.
i·-·Specifies that the sort on this field is to be case
insensitive.
c·-·Specifies that this field is ASCII character data, the default
if not specified. Since PDSORT 2.0.0 supports only ASCII
character fields, this option if only for upward compatibility
with future version of PDSORT that may support other field
types such as integer (numeric).
Examples:
Assume a file, named FILELIST, that contains a list of file name,
sizes, date/times, and paths, such as can be created by NUFIND:
a----w 27,974 90-04-30 6:30 c:\acelst.430
a----w 28,196 90-05-21 5:05 c:\acelst.521
a----w 28,238 90-05-25 5:41 c:\acelst.525
a----w 26,705 90-05-25 5:39 c:\acelst.lst
a----w 128,537 90-05-25 5:41 c:\acelst.zip
a----w 904 90-05-23 4:33 c:\autoexec.bat
a----w 35,840 89-06-30 12:16 c:\command.com
a----w 46 89-08-20 3:53 c:\config.cal
a----w 284 90-05-21 19:52 c:\config.sys
a----w 2,128 90-05-23 4:32 c:\configur.dat
------ 39,385 89-07-14 12:00 c:\drbdos.sys
------ 18,304 89-06-30 12:16 c:\drbios.sys
---sh- 4,096 90-03-18 13:22 c:\drildr.sys
a----w 167 89-10-11 7:56 c:\dsas.cmd
a----w 102 86-11-04 9:14 c:\ed.def
a----w 50,326 86-10-02 21:34 c:\ed.hlp
a----w 3,362 86-06-09 13:10 c:\fakey.com
a----w 0 90-05-23 7:54 c:\ftf.dat
a----w 12,275 85-06-16 18:12 c:\helpe.def
a----w 79 89-05-17 5:02 c:\indent.pro
a----w 7,122 90-01-15 1:00 c:\lineend.com
a----w 1,060 90-05-25 9:40 c:\mark0
a--sh- 41 90-05-25 9:40 c:\mi